<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <TITLE>trace example</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#000077" ALINK="#FF0000">
<H2>trace example</H2>

<B>Trace</B> runs the Java language program passed as an argument and
generates a trace of its execution.  <B>Trace</B> is a simple command
line tool that uses the 
<A HREF="http://java.sun.com/j2se/1.4/docs/guide/jpda/architecture.html#jdi">
Java Debug Interface (JDI)</A>.  Programs need
not be compiled for debugging since this information is not
used.  
<P>
<B>Trace</B> can be invoked as follows:
<PRE>
        java com.sun.tools.example.trace.Trace <i>options class args</i>
</PRE>
Your classpath must include the JDI Library 
(see <A HREF="index.html#SETUP">set-up</A>),
the path to the compiled <b>trace</b> class files,
and the path for the application being traced.
<P>
Available <i>options</i> are:

<PRE>
  -output <i>filename</i>   
        Set destination for output trace. By default output
        goes to the terminal.

  -all                 
        Include system classes in output.  By default
        java.*, javax.*, sun.* and com.sun.* events are
        not diplayed.

  -fields
        Also show assignments into fields.

  -help              
        Print a help message

</PRE>
<i>class</i> is the program to trace. <i>args</i> are the arguments to <i>class</i>.
<P>

<H2>Source for trace</H2>
Full source code for <b>trace</b> is included in the
<code>trace</code> directory of <code>examples.jar</code>.  
Source code for these example applications is included to provide concrete
examples for debugger developers.  Example code may be used, modified
and redistributed by debugger developers providing they adhere to the
terms in the COPYRIGHT notice.

<P>
<H2>Building trace</H2>
To completely rebuild the <b>trace</b> classes from the 
provided source files in the <code>trace</code> directory, 
you need only to compile them. No special
options are required, aside from those which set your classpath to 
include the <A HREF="index.html#SETUP">JDI Library</A>.

<P>
    <hr>
    <address><a href="mailto:java-debugger@java.sun.com">java-debugger@java.sun.com</a></address>
    </P>
<P>
</P>
</BODY>
</HTML>
